#include<iostream>
#include <windows.h>
using namespace std;
const int N=5001;
float m[N][N];
void m_reset(int n){
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++)
            m[i][j]=0;
        m[i][i]=1.0;
        for(int j=i+1;j<n;j++)
            m[i][j]=rand();
    }
    for(int k=0;k<n;k++)
        for(int i=k+1;i<n;i++)
            for(int j=0;j<n;j++)
                m[i][j]+=m[k][j];

}
void normal(int n){ //普通串行算法
    for(int k=0;k<n;k++){
        for(int j=k+1;j<n;j++)
            m[k][j]/=m[k][k];
        m[k][k]=1.0;
        for(int i=k+1;i<n;i++){
            for(int j=k+1;j<n;j++)
                m[i][j]-=m[i][k]*m[k][j];
            m[i][k]=0;
        }
    }

}


int main(){
    long long head,tail,freq;
    int n=64;
    m_reset(n);
    QueryPerformanceFrequency((LARGE_INTEGER *)&freq);
    QueryPerformanceCounter((LARGE_INTEGER*)&head);
    normal(n);
        QueryPerformanceCounter((LARGE_INTEGER*)&tail);
    cout<<(tail -head)*1000.0/freq<<"ms"<<endl;
    return 0;
}
